﻿Imports Microsoft.TeamFoundation.WorkItemTracking.Client

Public Class TeamHelpers

    Private Sub New()

    End Sub

    Public Shared ReadOnly Property HeatReferenceName() As String
        Get
            Return "HeatITSM.Ref"
        End Get
    End Property


    Public Shared Function CheckWorkItemField(ByVal wit As WorkItemType) As Boolean
        Dim v = (From fd As FieldDefinition In wit.FieldDefinitions Where fd.ReferenceName = HeatReferenceName).SingleOrDefault
        Return Not (v Is Nothing)
    End Function

    Public Shared Function GetWorkItemField(ByVal wi As WorkItem, ByVal Reference As String) As Field
        Dim v = (From f As Field In wi.Fields Where f.ReferenceName = Reference).SingleOrDefault
        Return v
    End Function

End Class
